<?php
/*
 * debug 搞定返回数据额
 * @author     Mark <zhaody901@126.com>
 * @copyright  Copyright (c) 2013 lemon team
 * @version    $Id: 85d4e84a48ab5aa20f21743962680369be8707cb $
 * @time       14-2-7 上午10:28
 */
class Debug{

	public static function json($errNo, $errMsg, $append = array()) {
		$appendStr = "";
		if (is_array($append)) {
			$appendStr .= "\n";
			foreach($append as $k => $v) {
				$appendStr .= "[{$k}=>{$v}]\n";
			}
		} else {
			$appendStr = "\n".$append;
		}
		$arr = array(
			'errNo' => $errNo,
			'errMsg' => $errMsg . $appendStr,
		);
		exit(json_encode($arr));
	}
}